Traffic Logging into the Database (not available in Lite version)

This allows recording the traffic counters into the database and building a fast and scalable traffic accounting system for your users. To use this feature you should specify:

What is the Traffic Samples parameter?

This sets a time interval for a single Traffic Sample. The Traffic Sample is an amount of bytes captured by the specific filter for the time interval started at the specific time.

How does TrafMeter write the counters into the database?

  1. A current value of the "ts" field is derived: 1) from a user-defined Traffic Samples parameter 2) from the current local time. For example, if the current time is 19:49 on August 22, 2003, then
     
    User-defined Traffic SamplesValue of ts (in the ymmddhhmi format)
    1 minute308221949
    5 minutes308221945
    15 minutes308221945
    30 minutes308221930
    1 hours308221900
    2 hours308221800
    1 day308220000

     
  2. The command "SELECT * FROM traffic_table WHERE ts=308222145" is issued and the database counters stored in the table are retrieved into a temporary counters storage.
  3. The counters, unsaved since the last database update are added to the counters stored in the temporary storage.
  4. The temporary counter storage is flushed into the database.